Fail loading Standard view??

Not sure what the limitations are for loading a view in a NOT-visible module (seems I recall some issues there!?).

But in any event I am trying to figure out why the below code FAILS to load the standard view if the module starts off NOT open.

Any ideas?

 

Module NOT open: I get this when I run the code:

Opened module with Standard view (invisible)...
Current view: Standard view
FAIL: ERROR LOADING VIEW "Standard view"!

But if the module is already open (visible!) when I run the code it works (I should note that I am running the code from the DXL window of the DOORS explorer, so in that context there is no current module, and it does the open to get the handle for the module that is already open/visible):

Opened module with Standard view (invisible)...
Current view: MyDefaultView
OK: Loaded view "Standard view" OK!

 

Here is the code:

string modFullName="/My/module/name"

Module m=current
if (! null m && fullName(m)==modFullName) { print "Desired module already open...\n" }
else { m=read(modFullName,false,true); print "Opened module with Standard view (invisible)...\n" }

print "Current view: " currentView(m) "\n"
View vw=view(item(fullName(m)),"Standard view") 
if (!load(m,vw)) { print "FAIL: ERROR LOADING VIEW \"" name(vw) "\"!\n" }
else           { print "OK: Loaded view \"" name(vw) "\" OK!\n" }

 


strathglass - Mon Nov 26 18:30:20 EST 2018

Re: Fail loading Standard view??
davidcs - Tue Nov 27 07:37:18 EST 2018

I just recall there things you can't do with a view, like loading, when the module is invisible. If I want to work with views I open the module visible.

Re: Fail loading Standard view??
strathglass - Tue Nov 27 13:10:50 EST 2018

davidcs - Tue Nov 27 07:37:18 EST 2018

I just recall there things you can't do with a view, like loading, when the module is invisible. If I want to work with views I open the module visible.

Yes, I think that is it...I will just open visible if I need to load ANY view, even the standard view.

Thnx,